Optimal. Leaf size=88 \[ -\frac {\cosh ^2\left (a+b x^2\right )}{x}-\frac {1}{2} \sqrt {b} e^{-2 a} \sqrt {\frac {\pi }{2}} \text {Erf}\left (\sqrt {2} \sqrt {b} x\right )+\frac {1}{2} \sqrt {b} e^{2 a} \sqrt {\frac {\pi }{2}} \text {Erfi}\left (\sqrt {2} \sqrt {b} x\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {5439, 5736,
5422, 5406, 2235, 2236} \begin {gather*} -\frac {1}{2} \sqrt {\frac {\pi }{2}} e^{-2 a} \sqrt {b} \text {Erf}\left (\sqrt {2} \sqrt {b} x\right )+\frac {1}{2} \sqrt {\frac {\pi }{2}} e^{2 a} \sqrt {b} \text {Erfi}\left (\sqrt {2} \sqrt {b} x\right )-\frac {\cosh ^2\left (a+b x^2\right )}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2235
Rule 2236
Rule 5406
Rule 5422
Rule 5439
Rule 5736
Rubi steps
\begin {align*} \int \frac {\cosh ^2\left (a+b x^2\right )}{x^2} \, dx &=-\frac {\cosh ^2\left (a+b x^2\right )}{x}+(4 b) \int \cosh \left (a+b x^2\right ) \sinh \left (a+b x^2\right ) \, dx\\ &=-\frac {\cosh ^2\left (a+b x^2\right )}{x}+(2 b) \int \sinh \left (2 \left (a+b x^2\right )\right ) \, dx\\ &=-\frac {\cosh ^2\left (a+b x^2\right )}{x}+(2 b) \int \sinh \left (2 a+2 b x^2\right ) \, dx\\ &=-\frac {\cosh ^2\left (a+b x^2\right )}{x}-b \int e^{-2 a-2 b x^2} \, dx+b \int e^{2 a+2 b x^2} \, dx\\ &=-\frac {\cosh ^2\left (a+b x^2\right )}{x}-\frac {1}{2} \sqrt {b} e^{-2 a} \sqrt {\frac {\pi }{2}} \text {erf}\left (\sqrt {2} \sqrt {b} x\right )+\frac {1}{2} \sqrt {b} e^{2 a} \sqrt {\frac {\pi }{2}} \text {erfi}\left (\sqrt {2} \sqrt {b} x\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.18, size = 94, normalized size = 1.07 \begin {gather*} \frac {-4 \cosh ^2\left (a+b x^2\right )+\sqrt {b} \sqrt {2 \pi } x \text {Erf}\left (\sqrt {2} \sqrt {b} x\right ) (-\cosh (2 a)+\sinh (2 a))+\sqrt {b} \sqrt {2 \pi } x \text {Erfi}\left (\sqrt {2} \sqrt {b} x\right ) (\cosh (2 a)+\sinh (2 a))}{4 x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.36, size = 86, normalized size = 0.98
method | result | size |
risch | \(-\frac {1}{2 x}-\frac {{\mathrm e}^{-2 a} {\mathrm e}^{-2 x^{2} b}}{4 x}-\frac {{\mathrm e}^{-2 a} \sqrt {b}\, \sqrt {\pi }\, \sqrt {2}\, \erf \left (x \sqrt {2}\, \sqrt {b}\right )}{4}-\frac {{\mathrm e}^{2 a} {\mathrm e}^{2 x^{2} b}}{4 x}+\frac {{\mathrm e}^{2 a} b \sqrt {\pi }\, \erf \left (\sqrt {-2 b}\, x \right )}{2 \sqrt {-2 b}}\) | \(86\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.32, size = 61, normalized size = 0.69 \begin {gather*} -\frac {\sqrt {2} \sqrt {b x^{2}} e^{\left (-2 \, a\right )} \Gamma \left (-\frac {1}{2}, 2 \, b x^{2}\right )}{8 \, x} - \frac {\sqrt {2} \sqrt {-b x^{2}} e^{\left (2 \, a\right )} \Gamma \left (-\frac {1}{2}, -2 \, b x^{2}\right )}{8 \, x} - \frac {1}{2 \, x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 394 vs.
\(2 (64) = 128\).
time = 0.41, size = 394, normalized size = 4.48 \begin {gather*} -\frac {\cosh \left (b x^{2} + a\right )^{4} + 4 \, \cosh \left (b x^{2} + a\right ) \sinh \left (b x^{2} + a\right )^{3} + \sinh \left (b x^{2} + a\right )^{4} + \sqrt {2} \sqrt {\pi } {\left (x \cosh \left (b x^{2} + a\right )^{2} \cosh \left (2 \, a\right ) + x \cosh \left (b x^{2} + a\right )^{2} \sinh \left (2 \, a\right ) + {\left (x \cosh \left (2 \, a\right ) + x \sinh \left (2 \, a\right )\right )} \sinh \left (b x^{2} + a\right )^{2} + 2 \, {\left (x \cosh \left (b x^{2} + a\right ) \cosh \left (2 \, a\right ) + x \cosh \left (b x^{2} + a\right ) \sinh \left (2 \, a\right )\right )} \sinh \left (b x^{2} + a\right )\right )} \sqrt {-b} \operatorname {erf}\left (\sqrt {2} \sqrt {-b} x\right ) + \sqrt {2} \sqrt {\pi } {\left (x \cosh \left (b x^{2} + a\right )^{2} \cosh \left (2 \, a\right ) - x \cosh \left (b x^{2} + a\right )^{2} \sinh \left (2 \, a\right ) + {\left (x \cosh \left (2 \, a\right ) - x \sinh \left (2 \, a\right )\right )} \sinh \left (b x^{2} + a\right )^{2} + 2 \, {\left (x \cosh \left (b x^{2} + a\right ) \cosh \left (2 \, a\right ) - x \cosh \left (b x^{2} + a\right ) \sinh \left (2 \, a\right )\right )} \sinh \left (b x^{2} + a\right )\right )} \sqrt {b} \operatorname {erf}\left (\sqrt {2} \sqrt {b} x\right ) + 2 \, {\left (3 \, \cosh \left (b x^{2} + a\right )^{2} + 1\right )} \sinh \left (b x^{2} + a\right )^{2} + 2 \, \cosh \left (b x^{2} + a\right )^{2} + 4 \, {\left (\cosh \left (b x^{2} + a\right )^{3} + \cosh \left (b x^{2} + a\right )\right )} \sinh \left (b x^{2} + a\right ) + 1}{4 \, {\left (x \cosh \left (b x^{2} + a\right )^{2} + 2 \, x \cosh \left (b x^{2} + a\right ) \sinh \left (b x^{2} + a\right ) + x \sinh \left (b x^{2} + a\right )^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cosh ^{2}{\left (a + b x^{2} \right )}}{x^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\mathrm {cosh}\left (b\,x^2+a\right )}^2}{x^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________